KERNAL_DIR := /home/linxincheng/imx6ull/bsp/kernel/linux-imx 
CROSS_COMPILE := /opt/gcc-arm-11.2-2022.02/bin/arm-none-linux-gnueabihf- 
TFTP_DIR := /tftp/linxincheng 
PWD := $(shell pwd) 
obj-m := chrdev.o

modules:
	$(MAKE) -C $(KERNAL_DIR) M=$(PWD) modules
	$(CROSS_COMPILE)gcc chrdevApp.c -o chrdevApp
	@make clear
	cp chrdev.ko chrdevAPP $(TFTP_DIR) -f

clear:
	@rm -f *.o *.cmd *.mod *.mod.c
	@rm -rf *~ core .depend .tmp_versions Module.symvers modules.order -f
	@rm -f .*ko.cmd .*.o.cmd .*.o.d
	@rm -f *.unsigned

clean:
	@rm -f *.ko

